﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyCustomers.aspx.cs" Inherits="Customer_MyCustomers" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../css/f_css.css" rel="stylesheet" type="text/css" />
    <link href="../css/listpage.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="../js/jquery-1.2.6.pack.js"></script>
    <script language="javascript" src="../js/subMsg.js" type="text/javascript"></script>
    <script language="javascript" src="../js/common.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        // Note: rowindex 可能不会代表当前的行号，因为有行添加删除或移动的话则不行
        function onRowStatusChanged(chk, rowIndex) {
            var tr = chk.parentNode.parentNode;
            if (chk.checked) {
                tr.style.backgroundColor = "#d6e2f6";
            }
            else {
                tr.style.backgroundColor = "";
            }
        }
    </script>
    <style type="text/css">
        /*#gv th
        {
            border:none;
        }*/
    #gv td, #gv th
    {
        /*border: none none none none;
        border: hidden;*/
        border-top:none;
        border-left:none;
        border-right:solid 1px #DDDDDD;
        border-bottom:solid 1px #DDDDDD;
    }
    .right
    {
        float: right;
    }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="titleText">
        我的客户 <span style="font-size: 12px; font-weight: normal;">
            (共<asp:Label runat="server" ID="lblAllCustomerCount"></asp:Label> 个客户)</span>
    </div>
    <div class="btdiv2">
            <asp:Button ID="btnRefresh" runat="server" CssClass="input00" Text="刷新" 
                onclick="btnRefresh_Click" />
            <asp:Button ID="btnDelete" runat="server" CssClass="input00" Text="删除" 
                onclick="btnDelete_Click" />
            <anthem:Button ID="Button5" runat="server" CssClass="input00" Text="列设置" />
            <anthem:Button ID="Button2" runat="server" CssClass="input00" Text="测试详细信息" OnClientClick="javascript:window.location.href='ShowCustomer.aspx';" />
        <div class="right">
            <webdiyer:AspNetPager ID="pager" runat="server" CssClass="pager" CustomInfoHTML="%CurrentPageIndex%/%PageCount%页&nbsp;&nbsp;"
                CustomInfoSectionWidth="12%" CustomInfoTextAlign="Right" 
                FirstPageText="首页" LastPageText="末页"
                LayoutType="Table" NextPageText="下一页" NumericButtonCount="6" NumericButtonTextFormatString="[{0}]"
                PageSize="20" PagingButtonSpacing="2px" PrevPageText="上一页" ShowCustomInfoSection="Left"
                SubmitButtonText="转到" onpagechanged="pager_PageChanged">
            </webdiyer:AspNetPager>
        </div>
    </div>
    <div class="tableContaner">
        <asp:GridView ID="gv" runat="server" CssClass="table2" AutoGenerateColumns="False">
            <Columns>
                <asp:TemplateField HeaderStyle-Width="20px" ItemStyle-HorizontalAlign="Center">
                    <HeaderTemplate>
                        <input type="checkbox" onclick="javascript:checkAll(this);" />
                    </HeaderTemplate>
                    <ItemTemplate>
                    <input type="checkbox" onclick='javascript:onRowStatusChanged(this, <%# Container.DataItemIndex %>);' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="客户名" DataField="Name" />
                <asp:BoundField HeaderText="英文名" DataField="Name_En" />
                <asp:TemplateField HeaderText="客户类型">
                    <ItemTemplate>
                        <%# GetCustomerClass((bool)Eval("IsApplicant"), (bool)Eval("IsCustomer")) %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="客户身份">
                    <ItemTemplate>
                        <%# GetCustomerType((int)Eval("CustomerType")) %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="城市" DataField="CityName" />
                <asp:BoundField HeaderText="电话" DataField="Tel" />
                <asp:BoundField HeaderText="创建时间" DataField="CreateDate" DataFormatString="{0:yyyy-M-dd}" />
                <asp:TemplateField HeaderText="操作" ItemStyle-Width="100px">
                    <ItemTemplate>
                        <a href='ShowCustomer.aspx?id=<%# Eval("AID") %>' title="查看详细信息">详细</a>
                        <a href='EditCustomer.aspx?op=edit&id=<%# Eval("AID") %>' title="编辑客户信息">编辑</a>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="listhead" />
            <AlternatingRowStyle CssClass="alt" />
        </asp:GridView>
    </div>
        <div class="btdiv2">
            &nbsp;<anthem:Button ID="Button3" runat="server" CssClass="input00" Text="刷新" />
            &nbsp;<anthem:Button ID="Button4" runat="server" CssClass="input00" Text="删除" />
        <div class="right">
            <webdiyer:AspNetPager ID="pager2" runat="server" CssClass="pager" CustomInfoHTML="%CurrentPageIndex%/%PageCount%页&nbsp;&nbsp;"
                CustomInfoSectionWidth="12%" CustomInfoTextAlign="Right" 
                FirstPageText="首页" LastPageText="末页"
                LayoutType="Table" NextPageText="下一页" NumericButtonCount="6" NumericButtonTextFormatString="[{0}]"
                PageSize="20" PagingButtonSpacing="2px" PrevPageText="上一页" ShowCustomInfoSection="Left"
                SubmitButtonText="转到" onpagechanged="pager2_PageChanged">
            </webdiyer:AspNetPager>
        </div>
    </div>
    </form>
</body>
</html>
